package edu.gatech.volt2.drdoommgt.domain;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum NameTitle {
	// The standard titles
	MR("Mr."), MRS("Mrs."), MS("Ms."), DR("Dr."), PHD("Ph.D"), 
	// These are types of medical doctors
	MD("MD."), DC("DC."), DO("D.O."), DDS("DDS."), DMD("DMD."), OD("O.D."), DPT("DPT."), DPM("DPM"), DVM("DVM");
	
	
	private static final Map<String,NameTitle> lookup = new HashMap<String,NameTitle>();

	static {
		for(NameTitle s : EnumSet.allOf(NameTitle.class))
			lookup.put(s.getText(), s);
	}

	private String text;

	private NameTitle(String text) {
		this.text = text;
	}

	public String getText() { return this.text; }

	public static NameTitle get(int code) { 
		return lookup.get(code); 
	}

}
